<template>
    <avue-crud :option="option" :data="data" >
    <template slot="id" slot-scope="scope">
        <el-button :size="scope.id" :type="scope.type">自定义内容</el-button>
    </template>
    </avue-crud>
</template>

<script>
import subject from '@/api/edu/subject'
export default {
  data(){
    return {
        data: [
            
        ],
        option: {
            headerAlign: 'center',
            align: 'center',
            border: true, //分割线
            index: true,
            defaultExpandAll:false, //是否展开
            column: [ //表头
            {
                label: '类别名称',
                prop: 'title',
                align: 'left',
                width: 200
            },
            // {
            //     label: '上级类别',
            //     prop: 'parentId',
            // },
            {
                label: '创建时间',
                prop: 'gmtCreate'
            },
            {
                label: '修改时间',
                prop: 'gmtModified'
            }
            ],
        }
    }
  },
  created(){
      this.getAllSubjectList()
  },
  methods:{
      getAllSubjectList() {
        subject.getTreeSubject()
            .then(response => {
                this.data = response.data.list
            })
    }
  }
  
}
</script>